<template>
  <view class="container">
    <view class="tobu">
      <view class="fanhui" @click="syiye">
        <image :src="imageUrl + '/yunzhanguan/yunzhanguanGroup-638.png'" class="image-img"></image>
      </view>
      <view class="biaoti1">云上展馆</view>
    </view>
    <view class="liebiao">
      <view class="liebiao1">
        <image :src="imageUrl + '/yunzhanguan/yunzhanguanGroup-1256.png'" class="image-img"></image>
      </view>
      <view class="liebiao2">
        <image :src="imageUrl + '/yunzhanguan/yunzhanguanGroup-1257.png'" class="image-img"></image>
      </view>
      <view class="liebiao3">
        <image :src="imageUrl + '/yunzhanguan/yunzhanguanGroup-1258.png'" class="image-img"></image>
      </view>
    </view>
  </view>
</template>

<script>
export default {
  data() {
    return {
      page2PreviousParam: '',
      imageUrl: this.$imageUrl,
    };
  },
  onLoad(options) {
      // 获取跳转传递过来的参数
      const page2PreviousParam = options.fromPage;
      if (page2PreviousParam) {
          this.page2PreviousParam = page2PreviousParam;
          wx.setStorageSync('page2StoredParam', page2PreviousParam);
          console.log('上一个页面传递的参数：', this.page2PreviousParam);
      } else {
          // 尝试从本地存储中读取上一次存储的值
          const storedValueFromStorage2 = wx.getStorageSync('page2StoredParam');
          if (storedValueFromStorage2) {
              this.page2PreviousParam = storedValueFromStorage2;
              console.log('使用上一次本地存储的值：', this.page2PreviousParam);
          } else {
              console.log('没有上一个页面传递的参数，也没有本地存储的值可用。');
          }
      }
  },
  methods: {
    syiye() {
      console.log('点击按钮触发,跳转页面');
      if (this.page2PreviousParam) {
        console.log('即将使用的跳转参数值：', this.page2PreviousParam);
        wx.redirectTo({
          url: `/${this.page2PreviousParam}`,
        });
      } else {
        console.log('没有上一个页面传递的参数，无法进行跳转。');
      }
    },
  },
};
</script>

<style>
.container {
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: #E4EBE9;
}
.image-img{
	width: 100%;
	height: 100%;
}
.tobu{
	width: 100%;
	height: 48rpx;
	margin-top: 7vh;
	display: flex;
}
.fanhui{
	width: 38rpx;
	height: 38rpx;
	margin-left: 26rpx;
}
.biaoti1{
	margin-left: 248rpx;
	width: 128rpx;
	height: 48rpx;
	font-family: Source Han Sans CN, Source Han Sans CN;
	font-weight: 500;
	font-size: 32rpx;
	color: #3F5649;
	line-height: 38rpx;
	text-align: center;
	font-style: normal;
	text-transform: none;
}
.liebiao{
	width: 100%;
	height: auto;
	display: flex;
	margin-top: 78rpx;
	flex-direction: column;
	justify-content: center;
}
.liebiao1{
	width: 91.5vw;
	height: 24vh;
	margin-left: 3.5%;
}
.liebiao2{
	width: 91.5vw;
	height: 24vh;
	margin-left: 3.5%;
	margin-top: 30rpx;
}
.liebiao3{
    width: 91.5vw;
	height: 24vh;
	margin-left: 3.5%;
	margin-top: 30rpx;
}
</style>